<script setup lang="ts">
import { reactive, ref, computed } from "vue";
import {
  selectListAll,
  listRacetrack,
  listNormalRacetrack,
  registProjectBasicInfoGetByUid,
  registProjectBusinessScenesGetByUid,
  registProjectSurveyDataGetByUid,
  registProjectComprehensiveInfoGetByUid,
  registProjectBasicInfoGetByUidOut,
  registProjectBusinessScenesGetByUidOut,
  registProjectSurveyDataGetByUidOut,
  registProjectComprehensiveInfoGetByUidOut,
  selectListAllOut,
} from "@/services/newsApi.ts";
import { FormInstance } from "@arco-design/web-vue";
import RepresentativeCases from "./RepresentativeCases.vue";
import type {
  RegistProjectBasicInfoSave,
  OtherChildrenListType,
} from "@/types/newsType";
import {
  listNormalRacetrackOut,
  listRacetrackOut,
} from "@/services/commonApi.ts";

const cases = ref<{
  init: (data: any) => void;
  clear: () => void;
  validate: () => object;
}>();

const props = defineProps({
  registUid: String,
  show: Number,
  type: String,
  link: String,
});
const projectInfo = ref([]);

const infoData = reactive({
  govNationalCount: "",
  govProvincialCount: "",
  govCityCount: "",
  researchInstituteCount: "",
  universityCount: "",
  institutionCount: "",
  largeEnterpriseCount: "",
  mediumEnterpriseCount: "",
  smallEnterpriseCount: "",
  individualUserCount: "",
  totalCustomerCount: "",
  agricultureForestry: [],
  miningIndustry: [],
  manufacturing: [],
  utilities: [],
  construction: [],
  wholesaleRetail: [],
  transportation: [],
  accommodationCatering: [],
  informationTechnology: [],
  finance: [],
  realEstate: [],
  leasingServices: [],
  scientificResearch: [],
  waterEnvironment: [],
  householdServices: [],
  educationIndustry: [],
  healthSocialWork: [],
  cultureSports: [],
  publicAdministration: [],
  internationalOrganizations: [],
  example: "",
  deploymentMode: [],
  chargeMode: [],
  revenueYear1: "",
  revenueYear2: "",
  revenueYear3: "",
  grossProfitYear1: "",
  grossProfitYear2: "",
  grossProfitYear3: "",
  developmentCost: "",
  roiPeriod: "",
  costReduction: "",
  managementCostReduction: "",
  productionCostReduction: "",
  logisticsCostReduction: "",
  laborCostReduction: "",
  otherCostReduction: "",
  efficiencyImprovement: "",
  workEfficiencyImprovement: "",
  accuracyImprovement: "",
  deliveryCycleReduction: "",
  otherImprovement: "",
  orderGrowth: "",
  marketShareGrowth: "",
  partnerCollaboration: "",
  employmentPromotion: "",
  greenDevelopment: "",
  publicService: "",
  regionalEconomyProvince: "",
  regionalEconomyCity: "",
  nationalStandards: "",
  industryStandards: "",
  localStandards: "",
  groupStandards: "",
  enterpriseStandards: "",
  otherSocialValues: "",
  otherGrowth: "",
  id: "",
  chargeModeOther: "",
  registUid: "",
});

// 基本信息
const basicInfo = reactive<RegistProjectBasicInfoSave>({
  projectName: "",
  id: "",
  channel: "",
  dataDirection: "",
  projectSource: "",
  projectDescription: "",
  registUid: "",
});

const sceneData = reactive<{
  id: string;
  digitalProducts: string[];
  productionManufacturing: string[];
  enterpriseManagement: string[];
  collaborativeInnovation: string[];
  publicManagement: string[];
  personalServices: string[];
  registUid: string;
  digitalProductsOther: string;
  productionManufacturingOther: string;
  enterpriseManagementOther: string;
  collaborativeInnovationOther: string;
  publicManagementOther: string;
  personalServicesOther: string;
}>({
  id: "",
  digitalProducts: [],
  productionManufacturing: [],
  enterpriseManagement: [],
  collaborativeInnovation: [],
  publicManagement: [],
  personalServices: [],
  registUid: "",
  digitalProductsOther: "",
  productionManufacturingOther: "",
  enterpriseManagementOther: "",
  collaborativeInnovationOther: "",
  publicManagementOther: "",
  personalServicesOther: "",
});

const surveyData = reactive({
  id: "",
  registUid: "",
  serviceObjects: [],
  dataSource: [],
  dataUpdateMode: [],
  dataAggregationMethod1: "",
  dataAggregationMethod2: "",
  dataAggregationMethod3: "",
  dataAggregationMethod4: "",
  dataVolumeGb: "",
  dataServiceOperation: "",
  transactionOrgPercentage: "",
  transactionOrgName: "",
  contractContractPercentage: "",
  mobileOnlinePercentage: "",
  productServiceType: [],
  dataAnalysisMethod: "",
  dataValueTargets: [],
  dataServiceMb: "",
  dataSourceOtherPublic: "",
  dataSourceOtherEnterprise: "",
  dataAggregationMethod4Other: "",
  dataAnalysisMethodName: "",
});

const getDeclarationList = () => {
  if (props.link === "out") {
    registProjectBasicInfoGetByUidOut({ registUid: props.registUid }).then(
      (res) => {
        if (res.code === 200) {
          if (res.data) {
            basicInfo.projectName = res.data.projectName;
            basicInfo.channel = res.data.channel;
            basicInfo.dataDirection = res.data.dataDirection;
            basicInfo.id = res.data.id;
            basicInfo.projectSource = res.data.projectSource;
            basicInfo.projectDescription = res.data.projectDescription;
            basicInfo.registUid = localStorage.getItem("userId") || "";
          }
        }
      }
    );
    registProjectBusinessScenesGetByUidOut({ registUid: props.registUid }).then(
      (res) => {
        if (res.code === 200) {
          if (res.data) {
            sceneData.id = res.data.id;

            sceneData.digitalProducts = res.data.digitalProducts.split(",");
            sceneData.digitalProductsOther = res.data.digitalProductsOther;

            sceneData.productionManufacturing =
              res.data.productionManufacturing.split(",");
            sceneData.productionManufacturingOther =
              res.data.productionManufacturingOther;

            sceneData.enterpriseManagement =
              res.data.enterpriseManagement.split(",");
            sceneData.enterpriseManagementOther =
              res.data.enterpriseManagementOther;

            sceneData.collaborativeInnovation =
              res.data.collaborativeInnovation.split(",");
            sceneData.collaborativeInnovationOther =
              res.data.collaborativeInnovationOther;

            sceneData.publicManagement = res.data.publicManagement.split(",");
            sceneData.publicManagementOther = res.data.publicManagementOther;

            sceneData.personalServices = res.data.personalServices.split(",");
            sceneData.personalServicesOther = res.data.personalServicesOther;

            sceneData.registUid = localStorage.getItem("userId") || "";
          }
        }
      }
    );
    registProjectSurveyDataGetByUidOut({ registUid: props.registUid }).then(
      (res) => {
        if (res.code === 200) {
          if (res.data) {
            surveyData.id = res.data.id;
            surveyData.registUid = res.data.registUid;
            surveyData.serviceObjects = res.data.serviceObjects.split(",");
            surveyData.dataSource = res.data.dataSource.split(",");
            surveyData.dataUpdateMode = res.data.dataUpdateMode.split(",");
            surveyData.dataAggregationMethod1 = res.data.dataAggregationMethod1;
            surveyData.dataAggregationMethod2 = res.data.dataAggregationMethod2;
            surveyData.dataAggregationMethod3 = res.data.dataAggregationMethod3;
            surveyData.dataAggregationMethod4 = res.data.dataAggregationMethod4;
            surveyData.dataVolumeGb = res.data.dataVolumeGb;
            surveyData.dataServiceOperation = res.data.dataServiceOperation;
            surveyData.transactionOrgPercentage =
              res.data.transactionOrgPercentage;
            surveyData.transactionOrgName = res.data.transactionOrgName;
            surveyData.contractContractPercentage =
              res.data.contractContractPercentage;
            surveyData.mobileOnlinePercentage = res.data.mobileOnlinePercentage;
            surveyData.productServiceType =
              res.data.productServiceType.split(",");
            surveyData.dataAnalysisMethod = res.data.dataAnalysisMethod;
            surveyData.dataValueTargets = res.data.dataValueTargets.split(",");
            surveyData.dataServiceMb = res.data.dataServiceMb;
            surveyData.dataSourceOtherPublic = res.data.dataSourceOtherPublic;
            surveyData.dataSourceOtherEnterprise =
              res.data.dataSourceOtherEnterprise;
            surveyData.dataAggregationMethod4Other =
              res.data.dataAggregationMethod4Other;
            surveyData.dataAnalysisMethodName = res.data.dataAnalysisMethodName;
          }
        }
      }
    );
    registProjectComprehensiveInfoGetByUidOut({
      registUid: props.registUid,
    }).then((res) => {
      if (res.code === 200) {
        if (res.data) {
          console.log(res, "resresresres");
          infoData.id = res.data.existingData.id;
          infoData.registUid = res.data.existingData.registUid;
          infoData.govNationalCount = res.data.existingData.govNationalCount;
          infoData.govProvincialCount =
            res.data.existingData.govProvincialCount;
          infoData.govCityCount = res.data.existingData.govCityCount;
          infoData.researchInstituteCount =
            res.data.existingData.researchInstituteCount;
          infoData.universityCount = res.data.existingData.universityCount;
          infoData.institutionCount = res.data.existingData.institutionCount;
          infoData.largeEnterpriseCount =
            res.data.existingData.largeEnterpriseCount;
          infoData.mediumEnterpriseCount =
            res.data.existingData.mediumEnterpriseCount;
          infoData.smallEnterpriseCount =
            res.data.existingData.smallEnterpriseCount;
          infoData.individualUserCount =
            res.data.existingData.individualUserCount;
          infoData.totalCustomerCount =
            res.data.existingData.totalCustomerCount;
          infoData.agricultureForestry =
            res.data.existingData.agricultureForestry.split(",");
          infoData.chargeModeOther = res.data.existingData.chargeModeOther;
          infoData.miningIndustry =
            res.data.existingData.miningIndustry.split(",");
          infoData.manufacturing =
            res.data.existingData.manufacturing.split(",");
          infoData.utilities = res.data.existingData.utilities.split(",");
          infoData.construction = res.data.existingData.construction.split(",");
          infoData.wholesaleRetail =
            res.data.existingData.wholesaleRetail.split(",");
          infoData.transportation =
            res.data.existingData.transportation.split(",");
          infoData.accommodationCatering =
            res.data.existingData.accommodationCatering.split(",");
          infoData.informationTechnology =
            res.data.existingData.informationTechnology.split(",");
          infoData.finance = res.data.existingData.finance.split(",");
          infoData.realEstate = res.data.existingData.realEstate.split(",");
          infoData.leasingServices =
            res.data.existingData.leasingServices.split(",");
          infoData.scientificResearch =
            res.data.existingData.scientificResearch.split(",");
          infoData.waterEnvironment =
            res.data.existingData.waterEnvironment.split(",");
          infoData.householdServices =
            res.data.existingData.householdServices.split(",");
          infoData.educationIndustry =
            res.data.existingData.educationIndustry.split(",");
          infoData.healthSocialWork =
            res.data.existingData.healthSocialWork.split(",");
          infoData.cultureSports =
            res.data.existingData.cultureSports.split(",");
          infoData.publicAdministration =
            res.data.existingData.publicAdministration.split(",");
          infoData.internationalOrganizations =
            res.data.existingData.internationalOrganizations.split(",");
          infoData.example = res.data.existingData.example;
          infoData.deploymentMode =
            res.data.existingData.deploymentMode.split(",");
          infoData.chargeMode = res.data.existingData.chargeMode.split(",");
          infoData.revenueYear1 = res.data.existingData.revenueYear1;
          infoData.revenueYear2 = res.data.existingData.revenueYear2;
          infoData.revenueYear3 = res.data.existingData.revenueYear3;
          infoData.grossProfitYear1 = res.data.existingData.grossProfitYear1;
          infoData.grossProfitYear2 = res.data.existingData.grossProfitYear2;
          infoData.grossProfitYear3 = res.data.existingData.grossProfitYear3;
          infoData.developmentCost = res.data.existingData.developmentCost;
          infoData.roiPeriod = res.data.existingData.roiPeriod;
          infoData.costReduction = res.data.existingData.costReduction;
          infoData.managementCostReduction =
            res.data.existingData.managementCostReduction;
          infoData.productionCostReduction =
            res.data.existingData.productionCostReduction;
          infoData.logisticsCostReduction =
            res.data.existingData.logisticsCostReduction;
          infoData.laborCostReduction =
            res.data.existingData.laborCostReduction;
          infoData.otherCostReduction =
            res.data.existingData.otherCostReduction;
          infoData.efficiencyImprovement =
            res.data.existingData.efficiencyImprovement;
          infoData.workEfficiencyImprovement =
            res.data.existingData.workEfficiencyImprovement;
          infoData.accuracyImprovement =
            res.data.existingData.accuracyImprovement;
          infoData.deliveryCycleReduction =
            res.data.existingData.deliveryCycleReduction;
          infoData.otherImprovement = res.data.existingData.otherImprovement;
          infoData.orderGrowth = res.data.existingData.orderGrowth;
          infoData.marketShareGrowth = res.data.existingData.marketShareGrowth;
          infoData.partnerCollaboration =
            res.data.existingData.partnerCollaboration;
          infoData.employmentPromotion =
            res.data.existingData.employmentPromotion;
          infoData.greenDevelopment = res.data.existingData.greenDevelopment;
          infoData.publicService = res.data.existingData.publicService;
          infoData.regionalEconomyCity =
            res.data.existingData.regionalEconomyCity;
          infoData.regionalEconomyProvince =
            res.data.existingData.regionalEconomyProvince;
          infoData.nationalStandards = res.data.existingData.nationalStandards;
          infoData.industryStandards = res.data.existingData.industryStandards;
          infoData.localStandards = res.data.existingData.localStandards;
          infoData.groupStandards = res.data.existingData.groupStandards;
          infoData.enterpriseStandards =
            res.data.existingData.enterpriseStandards;
          infoData.otherSocialValues = res.data.existingData.otherSocialValues;
          cases.value?.init(res.data.registProjectComprehensiveInfoEnterprise);
        }
      }
    });
  } else {
    registProjectBasicInfoGetByUid({ registUid: props.registUid }).then(
      (res) => {
        if (res.code === 200) {
          if (res.data) {
            basicInfo.projectName = res.data.projectName;
            basicInfo.channel = res.data.channel;
            basicInfo.dataDirection = res.data.dataDirection;
            basicInfo.id = res.data.id;
            basicInfo.projectSource = res.data.projectSource;
            basicInfo.projectDescription = res.data.projectDescription;
            basicInfo.registUid = localStorage.getItem("userId") || "";
          }
        }
      }
    );

    registProjectBusinessScenesGetByUid({ registUid: props.registUid }).then(
      (res) => {
        if (res.code === 200) {
          if (res.data) {
            sceneData.id = res.data.id;
            sceneData.digitalProducts = res.data.digitalProducts.split(",");
            sceneData.productionManufacturing =
              res.data.productionManufacturing.split(",");
            sceneData.enterpriseManagement =
              res.data.enterpriseManagement.split(",");
            sceneData.collaborativeInnovation =
              res.data.collaborativeInnovation.split(",");
            sceneData.publicManagement = res.data.publicManagement.split(",");
            sceneData.personalServices = res.data.personalServices.split(",");
            sceneData.registUid = localStorage.getItem("userId") || "";
          }
        }
      }
    );

    registProjectSurveyDataGetByUid({ registUid: props.registUid }).then(
      (res) => {
        if (res.code === 200) {
          if (res.data) {
            surveyData.id = res.data.id;
            surveyData.registUid = res.data.registUid;
            surveyData.serviceObjects = res.data.serviceObjects.split(",");
            surveyData.dataSource = res.data.dataSource.split(",");
            surveyData.dataUpdateMode = res.data.dataUpdateMode.split(",");
            surveyData.dataAggregationMethod1 = res.data.dataAggregationMethod1;
            surveyData.dataAggregationMethod2 = res.data.dataAggregationMethod2;
            surveyData.dataAggregationMethod3 = res.data.dataAggregationMethod3;
            surveyData.dataAggregationMethod4 = res.data.dataAggregationMethod4;
            surveyData.dataVolumeGb = res.data.dataVolumeGb;
            surveyData.dataServiceOperation = res.data.dataServiceOperation;
            surveyData.transactionOrgPercentage =
              res.data.transactionOrgPercentage;
            surveyData.transactionOrgName = res.data.transactionOrgName;
            surveyData.contractContractPercentage =
              res.data.contractContractPercentage;
            surveyData.mobileOnlinePercentage = res.data.mobileOnlinePercentage;
            surveyData.productServiceType =
              res.data.productServiceType.split(",");
            surveyData.dataAnalysisMethod = res.data.dataAnalysisMethod;
            surveyData.dataValueTargets = res.data.dataValueTargets.split(",");
            surveyData.dataServiceMb = res.data.dataServiceMb;
            surveyData.dataSourceOtherPublic = res.data.dataSourceOtherPublic;
            surveyData.dataSourceOtherEnterprise =
              res.data.dataSourceOtherEnterprise;
            surveyData.dataAggregationMethod4Other =
              res.data.dataAggregationMethod4Other;

            surveyData.dataAnalysisMethodName = res.data.dataAnalysisMethodName;
          }
        }
      }
    );

    registProjectComprehensiveInfoGetByUid({ registUid: props.registUid }).then(
      (res) => {
        if (res.code === 200) {
          if (res.data) {
            infoData.id = res.data.existingData.id;
            infoData.registUid = res.data.existingData.registUid;
            infoData.govNationalCount = res.data.existingData.govNationalCount;
            infoData.govProvincialCount =
              res.data.existingData.govProvincialCount;
            infoData.govCityCount = res.data.existingData.govCityCount;
            infoData.researchInstituteCount =
              res.data.existingData.researchInstituteCount;
            infoData.universityCount = res.data.existingData.universityCount;
            infoData.institutionCount = res.data.existingData.institutionCount;
            infoData.largeEnterpriseCount =
              res.data.existingData.largeEnterpriseCount;
            infoData.mediumEnterpriseCount =
              res.data.existingData.mediumEnterpriseCount;
            infoData.smallEnterpriseCount =
              res.data.existingData.smallEnterpriseCount;
            infoData.individualUserCount =
              res.data.existingData.individualUserCount;
            infoData.totalCustomerCount =
              res.data.existingData.totalCustomerCount;
            infoData.agricultureForestry =
              res.data.existingData.agricultureForestry.split(",");
            infoData.chargeModeOther = res.data.existingData.chargeModeOther;
            infoData.miningIndustry =
              res.data.existingData.miningIndustry.split(",");
            infoData.manufacturing =
              res.data.existingData.manufacturing.split(",");
            infoData.utilities = res.data.existingData.utilities.split(",");
            infoData.construction =
              res.data.existingData.construction.split(",");
            infoData.wholesaleRetail =
              res.data.existingData.wholesaleRetail.split(",");
            infoData.transportation =
              res.data.existingData.transportation.split(",");
            infoData.accommodationCatering =
              res.data.existingData.accommodationCatering.split(",");
            infoData.informationTechnology =
              res.data.existingData.informationTechnology.split(",");
            infoData.finance = res.data.existingData.finance.split(",");
            infoData.realEstate = res.data.existingData.realEstate.split(",");
            infoData.leasingServices =
              res.data.existingData.leasingServices.split(",");
            infoData.scientificResearch =
              res.data.existingData.scientificResearch.split(",");
            infoData.waterEnvironment =
              res.data.existingData.waterEnvironment.split(",");
            infoData.householdServices =
              res.data.existingData.householdServices.split(",");
            infoData.educationIndustry =
              res.data.existingData.educationIndustry.split(",");
            infoData.healthSocialWork =
              res.data.existingData.healthSocialWork.split(",");
            infoData.cultureSports =
              res.data.existingData.cultureSports.split(",");
            infoData.publicAdministration =
              res.data.existingData.publicAdministration.split(",");
            infoData.internationalOrganizations =
              res.data.existingData.internationalOrganizations.split(",");
            infoData.example = res.data.existingData.example;
            infoData.deploymentMode =
              res.data.existingData.deploymentMode.split(",");
            infoData.chargeMode = res.data.existingData.chargeMode.split(",");
            infoData.revenueYear1 = res.data.existingData.revenueYear1;
            infoData.revenueYear2 = res.data.existingData.revenueYear2;
            infoData.revenueYear3 = res.data.existingData.revenueYear3;
            infoData.grossProfitYear1 = res.data.existingData.grossProfitYear1;
            infoData.grossProfitYear2 = res.data.existingData.grossProfitYear2;
            infoData.grossProfitYear3 = res.data.existingData.grossProfitYear3;
            infoData.developmentCost = res.data.existingData.developmentCost;
            infoData.roiPeriod = res.data.existingData.roiPeriod;
            infoData.costReduction = res.data.existingData.costReduction;
            infoData.managementCostReduction =
              res.data.existingData.managementCostReduction;
            infoData.productionCostReduction =
              res.data.existingData.productionCostReduction;
            infoData.logisticsCostReduction =
              res.data.existingData.logisticsCostReduction;
            infoData.laborCostReduction =
              res.data.existingData.laborCostReduction;
            infoData.otherCostReduction =
              res.data.existingData.otherCostReduction;
            infoData.efficiencyImprovement =
              res.data.existingData.efficiencyImprovement;
            infoData.workEfficiencyImprovement =
              res.data.existingData.workEfficiencyImprovement;
            infoData.accuracyImprovement =
              res.data.existingData.accuracyImprovement;
            infoData.deliveryCycleReduction =
              res.data.existingData.deliveryCycleReduction;
            infoData.otherImprovement = res.data.existingData.otherImprovement;
            infoData.orderGrowth = res.data.existingData.orderGrowth;
            infoData.marketShareGrowth =
              res.data.existingData.marketShareGrowth;
            infoData.partnerCollaboration =
              res.data.existingData.partnerCollaboration;
            infoData.employmentPromotion =
              res.data.existingData.employmentPromotion;
            infoData.greenDevelopment = res.data.existingData.greenDevelopment;
            infoData.publicService = res.data.existingData.publicService;
            infoData.regionalEconomyCity =
              res.data.existingData.regionalEconomyCity;
            infoData.regionalEconomyProvince =
              res.data.existingData.regionalEconomyProvince;
            infoData.nationalStandards =
              res.data.existingData.nationalStandards;
            infoData.industryStandards =
              res.data.existingData.industryStandards;
            infoData.localStandards = res.data.existingData.localStandards;
            infoData.groupStandards = res.data.existingData.groupStandards;
            infoData.enterpriseStandards =
              res.data.existingData.enterpriseStandards;
            infoData.otherSocialValues =
              res.data.existingData.otherSocialValues;
          }
        }
      }
    );
  }

  setTimeout(() => {
    loading.value = false;
  }, 300);
};

const formRef = ref<FormInstance>();

const loading = ref(false);

const options = reactive({
  title: "",
  type: 0,
});

const show = () => {
  loading.value = true;
  options.type = 0;
  formRef.value?.clearValidate();
  projectInfo.value = [];
  setTimeout(() => {
    optionInit();
  }, 300);
};
const tabsValue2 = ref("");

const optionsList = reactive<{
  [key: string]: OtherChildrenListType[];
}>({
  数字产品设计: [],
  生产制造: [],
  参赛项目来源: [],
  企业管理: [],
  协同创新: [],
  公共管理: [],
  个人服务: [],
  项目服务对象: [],
  公共数据: [],
  企业数据: [],
  个人用户数据: [],
  数据更新频率: [],
  数据汇聚方式1: [],
  数据汇聚方式2: [],
  数据汇聚方式3: [],
  数据汇聚方式4: [],
  数据服务流通带宽: [],
  数据产品和服务类型: [],
  数据驱动的建模分析方式: [],
  数据价值目标: [],
  农林牧渔业: [],
  采矿业: [],
  制造业: [],
  "电力、热力、燃气及水生产和供应业": [],
  建筑业: [],
  批发和零售业: [],
  "交通运输、仓储和邮政业": [],
  住宿和餐饮业: [],
  "信息传输、软件和信息技术服务业": [],
  金融业: [],
  房地产业: [],
  租赁和商务服务业: [],
  科学研究和技术服务业: [],
  "水利、环境和公共设施管理业": [],
  "居民服务、修理和其他服务业": [],
  教育: [],
  卫生和社会工作: [],
  "文化、体育和娱乐业": [],
  "公共管理、社会保障和社会组织": [],
  国际组织: [],
  已实现落地应用的代表性案例: [],
  项目主要部署方式: [],
  项目主要收费模式: [],
  项目平均投资回报周期: [],
});

// 回显
const racetrackList = reactive<{
  s: [];
  c: OtherChildrenListType[];
}>({
  s: [],
  c: [],
});

const getItem = (key: string, id: string | string[], subId?: string) => {
  if (key === "赛道") {
    const find = racetrackList.s.find((item) => item.id === id);
    if (find) {
      return find.dictName;
    }
    return "";
  }
  if (key === "参赛方式") {
    const find = racetrackList.s.find((item) => item.id === id);
    if (find) {
      // dictName
      const dictFind = optionsList.value.find(
        (item) => item.dictCode === find.dictCode
      );
      if (dictFind) {
        const subFind = dictFind.dictItemList.find((item) => item.id === subId);
        if (subFind) return subFind.itemText;
      }
    }
    return "";
  }
  if (Array.isArray(id)) {
    const strs = id
      .map((item) => {
        return optionsList[key].find((keys) => keys.id === item)?.itemText;
      })
      .filter((item) => item);
    if (strs.length) {
      return strs.join("，");
    }
    return "";
  }
  const find = optionsList[key].find((item) => item.id === id);
  if (find) {
    return find.itemText;
  }
  return "";
};

// 参数初始化
function optionInit() {
  console.log(props);
  if (props.link === "out") {
    if (props.type == "1") {
      listRacetrackOut().then((res) => {
        if (res.code === 200) {
          racetrackList.s = res.data;
        } else {
        }
      });
    } else if (props.type == "0") {
      listNormalRacetrackOut().then((res) => {
        if (res.code === 200) {
          racetrackList.s = res.data;
        } else {
        }
      });
    }
    selectListAllOut()
      .then((res) => {
        if (res.code === 200) {
          optionsList.value = res.data;
          for (const key in optionsList) {
            const find = res.data.find((item) => item.dictCode === key);
            if (find) {
              optionsList[key] = find.dictItemList;
            }
          }
        }
      })
      .finally(() => {
        getDeclarationList();
      });
  } else {
    if (props.type == "1") {
      listRacetrack().then((res) => {
        if (res.code === 200) {
          racetrackList.s = res.data;
        } else {
        }
      });
    } else if (props.type == "0") {
      listNormalRacetrack().then((res) => {
        if (res.code === 200) {
          racetrackList.s = res.data;
        } else {
        }
      });
    }
    selectListAll()
      .then((res) => {
        if (res.code === 200) {
          optionsList.value = res.data;
          for (const key in optionsList) {
            const find = res.data.find((item) => item.dictCode === key);
            if (find) {
              optionsList[key] = find.dictItemList;
            }
          }
        }
      })
      .finally(() => {
        getDeclarationList();
      });
  }
}

// 动态计算总数量
const totalCustomerCount = computed(() => {
  const govNationalCount = Number(infoData.govNationalCount);
  const govProvincialCount = Number(infoData.govProvincialCount);
  const govCityCount = Number(infoData.govCityCount);
  const researchInstituteCount = Number(infoData.researchInstituteCount);
  const universityCount = Number(infoData.universityCount);
  const institutionCount = Number(infoData.institutionCount);
  const largeEnterpriseCount = Number(infoData.largeEnterpriseCount);
  const mediumEnterpriseCount = Number(infoData.mediumEnterpriseCount);
  const smallEnterpriseCount = Number(infoData.smallEnterpriseCount);
  const individualUserCount = Number(infoData.individualUserCount);
  return (
    govNationalCount +
    govProvincialCount +
    govCityCount +
    researchInstituteCount +
    universityCount +
    institutionCount +
    largeEnterpriseCount +
    mediumEnterpriseCount +
    smallEnterpriseCount +
    individualUserCount
  ).toString();
});

// 当前年份减去X
const currentYearMinus = (x: number) => {
  return new Date().getFullYear() - x;
};

defineExpose({
  show,
});
</script>

<template>
  <!-- <a-modal
    v-else
    v-model:visible="visible"
    ref="drawer"
    title="参赛项目基本信息"
    width="80%"
  >
    <div>
      <a-empty v-if="basicInfo.projectName == ''" />
      <div
        v-else
        style="height: 600px;overflow: auto;"
      >
        <a-tabs v-model="tabsValue2">
          <a-tab-pane
            key="1"
            title="基本信息"
          >
            <a-descriptions
              title=""
              bordered
              :column="1"
            >
              <a-descriptions-item>
                <template #label>
                  <span class="required-label">项目名称</span>
                </template>
                <span>{{ basicInfo.projectName }}</span>
              </a-descriptions-item>
            </a-descriptions>
          </a-tab-pane>

          <a-tab-pane
            key="2"
            title="数据开发利用"
          >
          </a-tab-pane>

          <a-tab-pane
            key="3"
            title="融资情况"
          >
          </a-tab-pane>
        </a-tabs>
      </div>
    </div>

    <template #footer>
      <a-button @click="handleClose">
        关闭
      </a-button>
    </template>
  </a-modal> -->

  <div>
    <a-empty v-if="basicInfo.projectName == ''" />
    <div v-else>
      <div
        v-if="loading"
        style="height: 700px;"
      >
        <div class="loading-overlay">
          <div class="loading-spinner"></div>
          <!-- <div class="loading-text">加载中...</div> -->
        </div>
      </div>

      <div
        v-else
        style="height:700px;overflow: auto;padding-bottom: 20px;"
      >
        <a-tabs
          v-model="tabsValue2"
          default-active-key="1"
        >
          <a-tab-pane
            key="1"
            title="基本信息"
          >
            <a-descriptions
              title=""
              bordered
              :column="1"
            >
              <a-descriptions-item>
                <template #label>
                  <span class="required-label">项目名称</span>
                </template>
                <span>{{ basicInfo.projectName }}</span>
              </a-descriptions-item>

              <a-descriptions-item>
                <template #label>
                  <span class="required-label">赛道及子赛题</span>
                </template>
                <span>{{ getItem('赛道', basicInfo.channel) }}</span><br>
                <span>{{ getItem('参赛方式', basicInfo.channel, basicInfo.dataDirection) }}</span>
              </a-descriptions-item>

              <a-descriptions-item>
                <template #label>
                  <span class="required-label">参赛项目来源</span>
                </template>
                <span>{{ getItem('参赛项目来源', basicInfo.projectSource) }}</span>
              </a-descriptions-item>

              <a-descriptions-item>
                <template #label>
                  <span class="required-label">参赛项目描述</span>
                </template>
                <span>{{ basicInfo.projectDescription }}</span>
              </a-descriptions-item>
            </a-descriptions>
          </a-tab-pane>

          <a-tab-pane
            key="2"
            title="项目覆盖的业务场景"
          >
            <a-descriptions
              title=""
              bordered
              :column="1"
            >
              <a-descriptions-item v-if="getItem('数字产品设计', sceneData.digitalProducts)">
                <template #label>
                  <span class="required-label">数字产品设计</span>
                </template>
                <span>{{ getItem('数字产品设计', sceneData.digitalProducts) }}
                  <span v-if="sceneData.digitalProductsOther">：{{ sceneData.digitalProductsOther }}</span>
                </span>
              </a-descriptions-item>

              <a-descriptions-item v-if="getItem('生产制造', sceneData.productionManufacturing)">
                <template #label>
                  <span class="required-label">生产制造</span>
                </template>
                <span>{{ getItem('生产制造', sceneData.productionManufacturing) }}
                  <span v-if="sceneData.productionManufacturingOther">：{{ sceneData.productionManufacturingOther }}</span>
                </span>
              </a-descriptions-item>

              <a-descriptions-item v-if="getItem('企业管理', sceneData.enterpriseManagement)">
                <template #label>
                  <span class="required-label">企业管理</span>
                </template>
                <span>{{ getItem('企业管理', sceneData.enterpriseManagement) }}
                  <span v-if="sceneData.enterpriseManagementOther">：{{ sceneData.enterpriseManagementOther }}</span>
                </span>
              </a-descriptions-item>

              <a-descriptions-item v-if="getItem('协同创新', sceneData.collaborativeInnovation)">
                <template #label>
                  <span class="required-label">协同创新</span>
                </template>
                <span>{{ getItem('协同创新', sceneData.collaborativeInnovation) }}
                  <span v-if="sceneData.collaborativeInnovationOther">：{{ sceneData.collaborativeInnovationOther }}</span>
                </span>
              </a-descriptions-item>

              <a-descriptions-item v-if="getItem('公共管理', sceneData.publicManagement)">
                <template #label>
                  <span class="required-label">公共管理</span>
                </template>
                <span>{{ getItem('公共管理', sceneData.publicManagement) }}
                  <span v-if="sceneData.publicManagementOther">：{{ sceneData.publicManagementOther }}</span>
                </span>
              </a-descriptions-item>

              <a-descriptions-item v-if="getItem('个人服务', sceneData.personalServices)">
                <template #label>
                  <span class="required-label">个人服务</span>
                </template>
                <span>{{ getItem('个人服务', sceneData.personalServices) }}
                  <span v-if="sceneData.personalServicesOther">：{{ sceneData.personalServicesOther }}</span>
                </span>
              </a-descriptions-item>
            </a-descriptions>
          </a-tab-pane>

          <a-tab-pane
            key="3"
            title="数据市场化"
            v-if="props.type === '0'"
          >
            <a-descriptions
              title=""
              bordered
              :column="1"
            >
              <a-descriptions-item>
                <template #label>
                  <span class="required-label">1. 项目服务对象</span>
                </template>
                <span>{{ getItem('项目服务对象', surveyData.serviceObjects) }}</span>
              </a-descriptions-item>

              <a-descriptions-item>
                <template #label>
                  <span class="required-label">2. 项目数据来源</span>
                </template>
                <div style="display: flex;flex-direction: column;">
                  <span v-if="getItem('公共数据', surveyData.dataSource)">公共数据：{{ getItem('公共数据', surveyData.dataSource) }}
                    <span v-if="surveyData.dataSourceOtherPublic">：{{ surveyData.dataSourceOtherPublic }}</span>
                  </span>
                  <span v-if=" getItem('企业数据', surveyData.dataSource)">企业数据：{{ getItem('企业数据', surveyData.dataSource) }}
                    <span v-if="surveyData.dataSourceOtherEnterprise">：{{ surveyData.dataSourceOtherEnterprise }}</span>
                  </span>
                  <span v-if="getItem('个人用户数据', surveyData.dataSource)">个人用户数据：{{ getItem('个人用户数据', surveyData.dataSource) }}</span>
                </div>
              </a-descriptions-item>

              <a-descriptions-item>
                <template #label>
                  <span class="required-label">3. 数据更新频率</span>
                </template>
                <span>{{ getItem('数据更新频率', surveyData.dataUpdateMode) }}</span>
              </a-descriptions-item>

              <a-descriptions-item>
                <template #label>
                  <span class="required-label">4.数据汇聚方式</span>
                </template>
                <div style="display: flex;flex-direction: column;">
                  <span v-if="getItem('数据汇聚方式1', surveyData.dataAggregationMethod1)">(1):{{ getItem('数据汇聚方式1', surveyData.dataAggregationMethod1) }}</span>
                  <span v-if="getItem('数据汇聚方式2', surveyData.dataAggregationMethod2)">(2):{{ getItem('数据汇聚方式2', surveyData.dataAggregationMethod2) }}</span>
                  <span v-if="getItem('数据汇聚方式3', surveyData.dataAggregationMethod3)">(3):{{ getItem('数据汇聚方式3', surveyData.dataAggregationMethod3) }}</span>
                  <span v-if="getItem('数据汇聚方式4', surveyData.dataAggregationMethod4)">
                    (4):{{ getItem('数据汇聚方式4', surveyData.dataAggregationMethod4) }}
                    <span v-if="surveyData.dataAggregationMethod4Other">：{{ surveyData.dataAggregationMethod4Other }}</span>
                  </span>
                </div>
              </a-descriptions-item>

              <a-descriptions-item>
                <template #label>
                  <span class="required-label">5.项目中，跨主体（企业或机构）交互的数据量（GB）</span>
                </template>
                <span>{{ surveyData.dataVolumeGb }}GB</span>
              </a-descriptions-item>

              <a-descriptions-item>
                <template #label>
                  <span class="required-label">6.数据服务流通带宽（MB）</span>
                </template>
                <span v-if="getItem('数据服务流通带宽', surveyData.dataServiceOperation) === '涉及'">{{ surveyData.dataServiceMb }}MB</span>
                <span v-else>{{ getItem('数据服务流通带宽', surveyData.dataServiceOperation) }}</span>
              </a-descriptions-item>

              <a-descriptions-item>
                <template #label>
                  <span class="required-label">7.数据交易形式</span>
                </template>
                <a-descriptions :column="1">
                  <a-descriptions-item label="来自交易机构的数据占比（%）">
                    <span>{{ surveyData.transactionOrgPercentage }}%</span>
                  </a-descriptions-item>
                  <a-descriptions-item label="交易机构名称">
                    <span>{{ surveyData.transactionOrgName }}</span>
                  </a-descriptions-item>
                  <a-descriptions-item label="来自点对点合同的数据占比（%）">
                    <span>{{ surveyData.contractContractPercentage }}%</span>
                  </a-descriptions-item>
                  <a-descriptions-item label="在线订阅的数据占比（%）">
                    <span>{{ surveyData.mobileOnlinePercentage }}%</span>
                  </a-descriptions-item>

                </a-descriptions>
              </a-descriptions-item>

              <a-descriptions-item>
                <template #label>
                  <span class="required-label">8.数据产品和服务类型</span>
                </template>
                <span>{{ getItem('数据产品和服务类型', surveyData.productServiceType) }}</span>
              </a-descriptions-item>

              <a-descriptions-item>
                <template #label>
                  <span class="required-label">9.数据驱动的建模分析方式</span>
                </template>
                <span>{{ getItem('数据驱动的建模分析方式', surveyData.dataAnalysisMethod) }}
                  <span v-if="surveyData.dataAnalysisMethodName"> 大模型名称: {{ surveyData.dataAnalysisMethodName }}</span>
                </span>
              </a-descriptions-item>

              <a-descriptions-item>
                <template #label>
                  <span class="required-label">10.数据价值目标</span>
                </template>
                <span>{{ getItem('数据价值目标', surveyData.dataValueTargets) }}</span>
              </a-descriptions-item>

            </a-descriptions>
          </a-tab-pane>

          <a-tab-pane
            key="4"
            title="应用场景"
          >

            <a-descriptions
              v-if="props.type === '0'"
              bordered
            >
              <template #title>
                <span class="required-label">项目服务的客户数量</span>
              </template>
              <a-descriptions-item>
                <template #label>
                  <span class="required-label">政府部门:国家级（个）</span>
                </template>
                <span>{{infoData.govNationalCount}}个</span>
              </a-descriptions-item>

              <a-descriptions-item>
                <template #label>
                  <span class="required-label">政府部门：省级（个）</span>
                </template>
                <span>{{infoData.govProvincialCount}}个</span>
              </a-descriptions-item>

              <a-descriptions-item>
                <template #label>
                  <span class="required-label">政府部门：地市级（个）</span>
                </template>
                <span>{{infoData.govCityCount}}个</span>
              </a-descriptions-item>

              <a-descriptions-item>
                <template #label>
                  <span class="required-label">科研院所（个）</span>
                </template>
                <span>{{infoData.govNationalCount}}个</span>
              </a-descriptions-item>

              <a-descriptions-item>
                <template #label>
                  <span class="required-label">高校（个）</span>
                </template>
                <span>{{infoData.universityCount}}个</span>
              </a-descriptions-item>

              <a-descriptions-item>
                <template #label>
                  <span class="required-label">事业单位（个）</span>
                </template>
                <span>{{infoData.institutionCount}}个</span>
              </a-descriptions-item>

              <a-descriptions-item>
                <template #label>
                  <span class="required-label">大企业（个）</span>
                </template>
                <span>{{infoData.largeEnterpriseCount}}个</span>
              </a-descriptions-item>

              <a-descriptions-item>
                <template #label>
                  <span class="required-label">中型企业（个）</span>
                </template>
                <span>{{infoData.mediumEnterpriseCount}}个</span>
              </a-descriptions-item>

              <a-descriptions-item>
                <template #label>
                  <span class="required-label">小微企业（个）</span>
                </template>
                <span>{{infoData.smallEnterpriseCount}}个</span>
              </a-descriptions-item>

              <a-descriptions-item>
                <template #label>
                  <span class="required-label">个人用户（个）</span>
                </template>
                <span>{{infoData.individualUserCount}}个</span>
              </a-descriptions-item>

              <a-descriptions-item>
                <template #label>
                  <span class="required-label">总数量（个）</span>
                </template>
                <span>{{totalCustomerCount}}个</span>
              </a-descriptions-item>
            </a-descriptions>

            <a-descriptions
              :column="1"
              v-if="props.type === '0'"
              bordered
              style="margin: 10px 0px;"
            >
              <template #title>
                <span class="required-label">项目适用行业</span>
              </template>
              <a-descriptions-item v-if="getItem('农林牧渔业', infoData.agricultureForestry)">
                <template #label>
                  <span class="required-label">农林牧渔业</span>
                </template>
                <span>{{getItem('农林牧渔业', infoData.agricultureForestry)}}</span>
              </a-descriptions-item>

              <a-descriptions-item v-if="getItem('采矿业', infoData.miningIndustry)">
                <template #label>
                  <span class="required-label">采矿业</span>
                </template>
                <span>{{getItem('采矿业', infoData.miningIndustry)}}</span>
              </a-descriptions-item>

              <a-descriptions-item v-if="getItem('制造业', infoData.manufacturing)">
                <template #label>
                  <span class="required-label">制造业</span>
                </template>
                <span>{{getItem('制造业', infoData.manufacturing)}}</span>
              </a-descriptions-item>

              <a-descriptions-item v-if="getItem('电力、热力、燃气及水生产和供应业', infoData.utilities)">
                <template #label>
                  <span class="required-label">电力、热力、燃气及水生产和供应业</span>
                </template>
                <span>{{getItem('电力、热力、燃气及水生产和供应业', infoData.utilities)}}</span>
              </a-descriptions-item>

              <a-descriptions-item v-if="getItem('建筑业', infoData.construction)">
                <template #label>
                  <span class="required-label">建筑业</span>
                </template>
                <span>{{getItem('建筑业', infoData.construction)}}</span>
              </a-descriptions-item>

              <a-descriptions-item v-if="getItem('批发和零售业', infoData.wholesaleRetail)">
                <template #label>
                  <span class="required-label">批发和零售业</span>
                </template>
                <span>{{getItem('批发和零售业', infoData.wholesaleRetail)}}</span>
              </a-descriptions-item>

              <a-descriptions-item v-if="getItem('交通运输、仓储和邮政业', infoData.transportation)">
                <template #label>
                  <span class="required-label">交通运输、仓储和邮政业</span>
                </template>
                <span>{{getItem('交通运输、仓储和邮政业', infoData.transportation)}}</span>
              </a-descriptions-item>

              <a-descriptions-item v-if="getItem('住宿和餐饮业', infoData.accommodationCatering)">
                <template #label>
                  <span class="required-label">住宿和餐饮业</span>
                </template>
                <span>{{getItem('住宿和餐饮业', infoData.accommodationCatering)}}</span>
              </a-descriptions-item>

              <a-descriptions-item v-if="getItem('信息传输、软件和信息技术服务业', infoData.informationTechnology)">
                <template #label>
                  <span class="required-label">信息传输、软件和信息技术服务业</span>
                </template>
                <span>{{getItem('信息传输、软件和信息技术服务业', infoData.informationTechnology)}}</span>
              </a-descriptions-item>

              <a-descriptions-item v-if="getItem('金融业', infoData.finance)">
                <template #label>
                  <span class="required-label">金融业</span>
                </template>
                <span>{{getItem('金融业', infoData.finance)}}</span>
              </a-descriptions-item>

              <a-descriptions-item v-if="getItem('房地产业', infoData.realEstate)">
                <template #label>
                  <span class="required-label">房地产业</span>
                </template>
                <span>{{getItem('房地产业', infoData.realEstate)}}</span>
              </a-descriptions-item>

              <a-descriptions-item v-if="getItem('租赁和商务服务业', infoData.leasingServices)">
                <template #label>
                  <span class="required-label">租赁和商务服务业</span>
                </template>
                <span>{{getItem('租赁和商务服务业', infoData.leasingServices)}}</span>
              </a-descriptions-item>

              <a-descriptions-item v-if="getItem('科学研究和技术服务业', infoData.scientificResearch)">
                <template #label>
                  <span class="required-label">科学研究和技术服务业</span>
                </template>
                <span>{{getItem('科学研究和技术服务业', infoData.scientificResearch)}}</span>
              </a-descriptions-item>

              <a-descriptions-item v-if="getItem('水利、环境和公共设施管理业', infoData.waterEnvironment)">
                <template #label>
                  <span class="required-label">水利、环境和公共设施管理业</span>
                </template>
                <span>{{getItem('水利、环境和公共设施管理业', infoData.waterEnvironment)}}</span>
              </a-descriptions-item>

              <a-descriptions-item v-if="getItem('居民服务、修理和其他服务业', infoData.householdServices)">
                <template #label>
                  <span class="required-label">居民服务、修理和其他服务业</span>
                </template>
                <span>{{getItem('居民服务、修理和其他服务业', infoData.householdServices)}}</span>
              </a-descriptions-item>

              <a-descriptions-item v-if="getItem('教育', infoData.educationIndustry)">
                <template #label>
                  <span class="required-label">教育</span>
                </template>
                <span>{{getItem('教育', infoData.educationIndustry)}}</span>
              </a-descriptions-item>

              <a-descriptions-item v-if="getItem('卫生和社会工作', infoData.healthSocialWork)">
                <template #label>
                  <span class="required-label">卫生和社会工作</span>
                </template>
                <span>{{getItem('卫生和社会工作', infoData.healthSocialWork)}}</span>
              </a-descriptions-item>

              <a-descriptions-item v-if="getItem('文化、体育和娱乐业', infoData.cultureSports)">
                <template #label>
                  <span class="required-label">文化、体育和娱乐业</span>
                </template>
                <span>{{getItem('文化、体育和娱乐业', infoData.cultureSports)}}</span>
              </a-descriptions-item>

              <a-descriptions-item v-if="getItem('公共管理、社会保障和社会组织', infoData.publicAdministration)">
                <template #label>
                  <span class="required-label">公共管理、社会保障和社会组织</span>
                </template>
                <span>{{getItem('公共管理、社会保障和社会组织', infoData.publicAdministration)}}</span>
              </a-descriptions-item>

              <a-descriptions-item v-if="getItem('国际组织', infoData.internationalOrganizations)">
                <template #label>
                  <span class="required-label">国际组织</span>
                </template>
                <span>{{getItem('国际组织', infoData.internationalOrganizations)}}</span>
              </a-descriptions-item>
            </a-descriptions>

            <a-descriptions
              title=""
              bordered
              :column="1"
            >
              <a-descriptions-item v-if="props.type === '0'">
                <template #label>
                  <span>已实现落地应用的代表性案例</span>
                </template>
                <span>{{ getItem('已实现落地应用的代表性案例', infoData.example) }}</span>

                <!-- <div v-if="infoData.example">
                  <RepresentativeCases
                    ref="cases"
                    :readonly="true"
                  />
                </div> -->
              </a-descriptions-item>

              <a-descriptions-item>
                <template #label>
                  <span>项目主要部署方式</span>
                </template>
                <span>{{ getItem('项目主要部署方式', infoData.deploymentMode) }}</span>
              </a-descriptions-item>

              <a-descriptions-item v-if="props.type === '0'">
                <template #label>
                  <span>项目主要收费模式</span>
                </template>
                <span>{{ getItem('项目主要收费模式', infoData.chargeMode) }}
                  <span v-if="infoData.chargeModeOther">：{{ infoData.chargeModeOther }}</span>
                </span>
              </a-descriptions-item>

              <a-descriptions-item v-if="props.type === '0'">
                <template #label>
                  <span>项目市场收入</span>
                </template>
                <a-descriptions :column="1">
                  <a-descriptions-item>
                    <template #label>
                      <span>{{ currentYearMinus(2) }}年（单位：万元）</span>
                    </template>
                    <span>{{infoData.revenueYear3}}万元</span>
                  </a-descriptions-item>

                  <a-descriptions-item>
                    <template #label>
                      <span>{{ currentYearMinus(1) }}年（单位：万元）</span>
                    </template>
                    <span>{{infoData.revenueYear2}}万元</span>
                  </a-descriptions-item>

                  <a-descriptions-item>
                    <template #label>
                      <span>{{ currentYearMinus(0) }}年（预期）（单位：万元）</span>
                    </template>
                    <span>{{infoData.revenueYear1}}万元</span>
                  </a-descriptions-item>
                </a-descriptions>
              </a-descriptions-item>

              <a-descriptions-item v-if="props.type === '0'">
                <template #label>
                  <span>项目毛利润（万元）</span>
                </template>
                <a-descriptions :column="1">
                  <a-descriptions-item>
                    <template #label>
                      <span> {{ currentYearMinus(2) }}年（单位：万元）</span>
                    </template>
                    <span>{{infoData.grossProfitYear3}}万元</span>
                  </a-descriptions-item>

                  <a-descriptions-item>
                    <template #label>
                      <span>{{ currentYearMinus(1) }}年（单位：万元）</span>
                    </template>
                    <span>{{infoData.grossProfitYear2}}万元</span>
                  </a-descriptions-item>

                  <a-descriptions-item>
                    <template #label>
                      <span>{{ currentYearMinus(0) }}年（预期）（单位：万元）</span>
                    </template>
                    <span>{{infoData.grossProfitYear1}}万元</span>
                  </a-descriptions-item>
                </a-descriptions>
              </a-descriptions-item>

              <a-descriptions-item>
                <template #label>
                  <span class="required-label">项目开发成本（万元）</span>
                </template>
                <span>{{infoData.developmentCost}}万元</span>
              </a-descriptions-item>

              <a-descriptions-item v-if="props.type === '0'">
                <template #label>
                  <span class="required-label">项目平均投资回报周期</span>
                </template>
                <span>{{getItem('项目平均投资回报周期', infoData.roiPeriod)}}</span>
              </a-descriptions-item>

              <a-descriptions
                :column="1"
                v-if="props.type === '0'"
              >
                <template #label>
                  <span>项目应用成效</span>
                </template>
                <a-descriptions
                  :column="1"
                  v-if="infoData.costReduction || infoData.managementCostReduction ||  
                infoData.productionCostReduction || infoData.logisticsCostReduction || 
                infoData.laborCostReduction ||infoData.otherCostReduction || infoData.efficiencyImprovement
                || infoData.workEfficiencyImprovement || infoData.accuracyImprovement || infoData.deliveryCycleReduction
                || infoData.otherImprovement"
                >
                  <template #label>
                    <span>存量价值</span>
                  </template>
                  <a-descriptions-item>
                    <template #label>
                      <span>降低成本（万元）</span>
                    </template>
                    <span>{{infoData.costReduction}}万元</span>
                  </a-descriptions-item>

                  <a-descriptions-item>
                    <template #label>
                      <span>降低管理成本</span>
                    </template>
                    <span>{{infoData.managementCostReduction}}</span>
                  </a-descriptions-item>

                  <a-descriptions-item>
                    <template #label>
                      <span>降低生产成本</span>
                    </template>
                    <span>{{infoData.productionCostReduction}}</span>
                  </a-descriptions-item>

                  <a-descriptions-item>
                    <template #label>
                      <span>降低流转成本</span>
                    </template>
                    <span>{{infoData.logisticsCostReduction}}</span>
                  </a-descriptions-item>

                  <a-descriptions-item>
                    <template #label>
                      <span>降低人力成本</span>
                    </template>
                    <span>{{infoData.laborCostReduction}}</span>
                  </a-descriptions-item>

                  <a-descriptions-item>
                    <template #label>
                      <span class="required-label">其他</span>
                    </template>
                    <span>{{infoData.otherCostReduction}}</span>
                  </a-descriptions-item>

                  <a-descriptions-item>
                    <template #label>
                      <span class="required-label">提高效率%</span>
                    </template>
                    <span>{{infoData.efficiencyImprovement}}</span>
                  </a-descriptions-item>

                  <a-descriptions-item>
                    <template #label>
                      <span class="required-label">提高工作效率</span>
                    </template>
                    <span>{{infoData.workEfficiencyImprovement}}</span>
                  </a-descriptions-item>

                  <a-descriptions-item>
                    <template #label>
                      <span class="required-label">提高工作准确率</span>
                    </template>
                    <span>{{infoData.accuracyImprovement}}</span>
                  </a-descriptions-item>

                  <a-descriptions-item>
                    <template #label>
                      <span class="required-label">缩短交付周期</span>
                    </template>
                    <span>{{infoData.deliveryCycleReduction}}</span>
                  </a-descriptions-item>

                  <a-descriptions-item>
                    <template #label>
                      <span class="required-label">其他</span>
                    </template>
                    <span>{{infoData.otherImprovement}}</span>
                  </a-descriptions-item>

                </a-descriptions>

                <a-descriptions
                  :column="1"
                  v-if="infoData.orderGrowth || infoData.marketShareGrowth ||  infoData.partnerCollaboration || infoData.otherGrowth "
                >
                  <template #label>
                    <span>增量价值</span>
                  </template>
                  <a-descriptions-item>
                    <template #label>
                      <span>订单增长</span>
                    </template>
                    <span>{{infoData.orderGrowth}}</span>
                  </a-descriptions-item>

                  <a-descriptions-item>
                    <template #label>
                      <span>市场份额增长</span>
                    </template>
                    <span>{{infoData.marketShareGrowth}}</span>
                  </a-descriptions-item>

                  <a-descriptions-item>
                    <template #label>
                      <span>带动合作伙伴/上下游企业协同</span>
                    </template>
                    <span>{{infoData.partnerCollaboration}}</span>
                  </a-descriptions-item>

                  <a-descriptions-item>
                    <template #label>
                      <span>其他</span>
                    </template>
                    <span>{{infoData.otherGrowth}}</span>
                  </a-descriptions-item>
                </a-descriptions>

                <a-descriptions
                  :column="1"
                  v-if="infoData.employmentPromotion || infoData.greenDevelopment ||  infoData.publicService 
                || infoData.regionalEconomyProvince || infoData.nationalStandards || infoData.industryStandards || infoData.localStandards
                || infoData.groupStandards || infoData.enterpriseStandards || infoData.otherSocialValues"
                >
                  <template #label>
                    <span>社会价值</span>
                  </template>
                  <a-descriptions-item>
                    <template #label>
                      <span>促进就业（人）</span>
                    </template>
                    <span>{{infoData.employmentPromotion}}人</span>
                  </a-descriptions-item>

                  <a-descriptions-item>
                    <template #label>
                      <span>绿色低碳（吨）</span>
                    </template>
                    <span>{{infoData.greenDevelopment}}吨</span>
                  </a-descriptions-item>

                  <a-descriptions-item>
                    <template #label>
                      <span>普惠服务（人）</span>
                    </template>
                    <span>{{infoData.publicService}}人</span>
                  </a-descriptions-item>

                  <a-descriptions-item>
                    <template #label>
                      <span>促进区域经济发展（个）省</span>
                    </template>
                    <span>{{infoData.regionalEconomyProvince}}个</span>
                  </a-descriptions-item>

                  <a-descriptions-item>
                    <template #label>
                      <span>形成标准（个）国家标准</span>
                    </template>
                    <span>{{infoData.nationalStandards}}个</span>
                  </a-descriptions-item>

                  <a-descriptions-item>
                    <template #label>
                      <span>形成标准（个）行业标准</span>
                    </template>
                    <span>{{infoData.industryStandards}}个</span>
                  </a-descriptions-item>

                  <a-descriptions-item>
                    <template #label>
                      <span>形成标准（个）地方标准</span>
                    </template>
                    <span>{{infoData.localStandards}}个</span>
                  </a-descriptions-item>

                  <a-descriptions-item>
                    <template #label>
                      <span>形成标准（个）团体标准</span>
                    </template>
                    <span>{{infoData.groupStandards}}个</span>
                  </a-descriptions-item>

                  <a-descriptions-item>
                    <template #label>
                      <span>形成标准（个）企业标准</span>
                    </template>
                    <span>{{infoData.enterpriseStandards}}个</span>
                  </a-descriptions-item>

                  <a-descriptions-item>
                    <template #label>
                      <span>其他</span>
                    </template>
                    <span>{{infoData.otherSocialValues}}</span>
                  </a-descriptions-item>
                </a-descriptions>
              </a-descriptions>

              <a-descriptions
                :column="1"
                v-if="props.type === '1'"
              >
                <template #label>
                  <span>项目应用成效</span>
                </template>
                <a-descriptions
                  :column="1"
                  v-if="infoData.costReduction || infoData.managementCostReduction ||  
                infoData.productionCostReduction || infoData.logisticsCostReduction || 
                infoData.laborCostReduction ||infoData.otherCostReduction || infoData.efficiencyImprovement
                || infoData.workEfficiencyImprovement || infoData.accuracyImprovement || infoData.deliveryCycleReduction
                || infoData.otherImprovement"
                >
                  <template #label>
                    <span>存量价值</span>
                  </template>
                  <a-descriptions-item v-if="infoData.costReduction">
                    <template #label>
                      <span>降低成本（万元）</span>
                    </template>
                    <span>{{infoData.costReduction}}万元</span>
                  </a-descriptions-item>

                  <a-descriptions-item v-if="infoData.managementCostReduction">
                    <template #label>
                      <span>降低管理成本</span>
                    </template>
                    <span>{{infoData.managementCostReduction}}</span>
                  </a-descriptions-item>

                  <a-descriptions-item v-if="infoData.productionCostReduction">
                    <template #label>
                      <span>降低生产成本</span>
                    </template>
                    <span>{{infoData.productionCostReduction}}</span>
                  </a-descriptions-item>

                  <a-descriptions-item v-if="infoData.logisticsCostReduction">
                    <template #label>
                      <span>降低流转成本</span>
                    </template>
                    <span>{{infoData.logisticsCostReduction}}</span>
                  </a-descriptions-item>

                  <a-descriptions-item v-if="infoData.laborCostReduction">
                    <template #label>
                      <span>降低人力成本</span>
                    </template>
                    <span>{{infoData.laborCostReduction}}</span>
                  </a-descriptions-item>

                  <a-descriptions-item v-if="infoData.otherCostReduction">
                    <template #label>
                      <span class="required-label">其他</span>
                    </template>
                    <span>{{infoData.otherCostReduction}}</span>
                  </a-descriptions-item>

                  <a-descriptions-item v-if="infoData.efficiencyImprovement">
                    <template #label>
                      <span class="required-label">提高效率%</span>
                    </template>
                    <span>{{infoData.efficiencyImprovement}}</span>
                  </a-descriptions-item>

                  <a-descriptions-item v-if="infoData.workEfficiencyImprovement">
                    <template #label>
                      <span class="required-label">提高工作效率</span>
                    </template>
                    <span>{{infoData.workEfficiencyImprovement}}</span>
                  </a-descriptions-item>

                  <a-descriptions-item v-if="infoData.accuracyImprovement">
                    <template #label>
                      <span class="required-label">提高工作准确率</span>
                    </template>
                    <span>{{infoData.accuracyImprovement}}</span>
                  </a-descriptions-item>

                  <a-descriptions-item v-if="infoData.deliveryCycleReduction">
                    <template #label>
                      <span class="required-label">缩短交付周期</span>
                    </template>
                    <span>{{infoData.deliveryCycleReduction}}</span>
                  </a-descriptions-item>

                  <a-descriptions-item v-if="infoData.otherImprovement">
                    <template #label>
                      <span class="required-label">其他</span>
                    </template>
                    <span>{{infoData.otherImprovement}}</span>
                  </a-descriptions-item>

                </a-descriptions>

                <a-descriptions
                  :column="1"
                  v-if="infoData.orderGrowth || infoData.marketShareGrowth ||  infoData.partnerCollaboration || infoData.otherGrowth "
                >
                  <template #label>
                    <span>增量价值</span>
                  </template>
                  <a-descriptions-item v-if="infoData.orderGrowth">
                    <template #label>
                      <span>订单增长</span>
                    </template>
                    <span>{{infoData.orderGrowth}}</span>
                  </a-descriptions-item>

                  <a-descriptions-item v-if="infoData.marketShareGrowth">
                    <template #label>
                      <span>市场份额增长</span>
                    </template>
                    <span>{{infoData.marketShareGrowth}}</span>
                  </a-descriptions-item>

                  <a-descriptions-item v-if="infoData.partnerCollaboration">
                    <template #label>
                      <span>带动合作伙伴/上下游企业协同</span>
                    </template>
                    <span>{{infoData.partnerCollaboration}}</span>
                  </a-descriptions-item>

                  <a-descriptions-item v-if="infoData.otherGrowth">
                    <template #label>
                      <span>其他</span>
                    </template>
                    <span>{{infoData.otherGrowth}}</span>
                  </a-descriptions-item>
                </a-descriptions>

                <a-descriptions
                  :column="1"
                  v-if="infoData.employmentPromotion || infoData.greenDevelopment ||  infoData.publicService "
                >
                  <template #label>
                    <span>社会价值</span>
                  </template>
                  <a-descriptions-item v-if="infoData.employmentPromotion">
                    <template #label>
                      <span>项目规模化推广后对产业链的影响</span>
                    </template>
                    <span>{{infoData.employmentPromotion}}</span>
                  </a-descriptions-item>

                  <a-descriptions-item v-if="infoData.greenDevelopment">
                    <template #label>
                      <span>项目对所应用的行业发展的影响</span>
                    </template>
                    <span>{{infoData.greenDevelopment}}</span>
                  </a-descriptions-item>

                  <a-descriptions-item v-if="infoData.publicService">
                    <template #label>
                      <span>项目对技术发展的预期影响</span>
                    </template>
                    <span>{{infoData.publicService}}</span>
                  </a-descriptions-item>
                </a-descriptions>
              </a-descriptions>
            </a-descriptions>
          </a-tab-pane>
        </a-tabs>
      </div>
    </div>
  </div>

</template>

<style scoped lang="scss">
.required-label {
  font-size: 15px;
}

.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.loading-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin-bottom: 10px;
}

.loading-text {
  font-size: 1px;
  color: #333;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
</style>
